package com.tedu.demo;
import java.io.*;

//测试复习字节流
public class Test03 {
    public static void main(String[] args) {
        method();
    }
    //字节流读取
    private static void method()  {
        //创建对象
        InputStream in = null;
        try {
            in = new BufferedInputStream(new FileInputStream(""));
            //读取
            in.read();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            //释放资源
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
    private static void method2()  {
        //创建对象
        try(InputStream in = new BufferedInputStream(new FileInputStream(""));) {
            //读取
            in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
